/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class ListPruebaPDS1Data {
	private static final int ROW_COUNT = 100;
	
public void listTestData() throws PersistentException {
		orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
		System.out.println("Listing Tda_tipoGasolina...");
		orm.Tda_tipoGasolina[] ormTda_tipoGasolinas = lDAOFactory.getTda_tipoGasolinaDAO().listTda_tipoGasolinaByQuery(null, null);
		int length = Math.min(ormTda_tipoGasolinas.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTda_tipoGasolinas[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Tdp_precio...");
		orm.Tdp_precio[] ormTdp_precios = lDAOFactory.getTdp_precioDAO().listTdp_precioByQuery(null, null);
		length = Math.min(ormTdp_precios.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTdp_precios[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Tcl_log...");
		orm.Tcl_log[] ormTcl_logs = lDAOFactory.getTcl_logDAO().listTcl_logByQuery(null, null);
		length = Math.min(ormTcl_logs.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTcl_logs[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
	}
	
	public void listByCriteria() throws PersistentException  {
		System.out.println("Listing Tda_tipoGasolina by Criteria...");
		orm.Tda_tipoGasolinaCriteria tda_tipoGasolinaCriteria = new orm.Tda_tipoGasolinaCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//tda_tipoGasolinaCriteria.tga_id.eq();
		tda_tipoGasolinaCriteria.setMaxResults(ROW_COUNT);
		orm.Tda_tipoGasolina[] ormTda_tipoGasolinas = tda_tipoGasolinaCriteria.listTda_tipoGasolina();
		int length =ormTda_tipoGasolinas== null ? 0 : Math.min(ormTda_tipoGasolinas.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTda_tipoGasolinas[i]);
		}
		System.out.println(length + " Tda_tipoGasolina record(s) retrieved."); 
		
		System.out.println("Listing Tdp_precio by Criteria...");
		orm.Tdp_precioCriteria tdp_precioCriteria = new orm.Tdp_precioCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//tdp_precioCriteria.pre_id.eq();
		tdp_precioCriteria.setMaxResults(ROW_COUNT);
		orm.Tdp_precio[] ormTdp_precios = tdp_precioCriteria.listTdp_precio();
		length =ormTdp_precios== null ? 0 : Math.min(ormTdp_precios.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTdp_precios[i]);
		}
		System.out.println(length + " Tdp_precio record(s) retrieved."); 
		
		System.out.println("Listing Tcl_log by Criteria...");
		orm.Tcl_logCriteria tcl_logCriteria = new orm.Tcl_logCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//tcl_logCriteria.log_id.eq();
		tcl_logCriteria.setMaxResults(ROW_COUNT);
		orm.Tcl_log[] ormTcl_logs = tcl_logCriteria.listTcl_log();
		length =ormTcl_logs== null ? 0 : Math.min(ormTcl_logs.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTcl_logs[i]);
		}
		System.out.println(length + " Tcl_log record(s) retrieved."); 
		
	}
	
	public static void main(String[] args) {
		try {
			ListPruebaPDS1Data listPruebaPDS1Data = new ListPruebaPDS1Data();
			try {
				listPruebaPDS1Data.listTestData();
				//listPruebaPDS1Data.listByCriteria();
			}
			finally {
				orm.PruebaPDS1PersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
